<!DOCTYPE html>
<html>
<head>
    <title>阿里玩兔图片上传说明</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
	<link href="../../../assets/img/icon/favicon.ico" rel="shortcut icon" />
    <style type="text/css">
    input[readonly] {
    	width: 100%;
    	border: 1px solid transparent;
    }
    p {
    	margin:0;
    }
    .mt-split {
    	margin-top: 15px;
    }
    </style>
</head>
<body>
<div><b>阿里玩兔图片上传说明</b></div>
<form>
<p class="mt-split"><input type="file" data-zupload="pictureUrl" name="pictureFile" /></p>
<p><input type="text" readonly name="pictureUrl" /></p>
<br/>
<p><img data-zupload="aliUrl" crossOrigin="*" width="100" src="http://anyinfo-its.image.alimmdn.com/files/2016/11/13/201820696583776.jpeg" /></p>
<p><input type="text" readonly name="aliUrl" /></p>
</form>
<p class="mt-split"><button name="upload">上传</button></p>
<pre>
</pre>
</body>
<script src="../../../assets/libs/jquery/jquery.1.11.1.js"></script>
<script src="../../../assets/libs/zhh.tools/zhh.tools.js"></script>
<script src="../../../assets/libs/zfiles/wantu.js"></script>
<script src="../../../assets/base/utils.js"></script>
<script src="../../../assets/base/config.js"></script>
<script src="../../../assets/libs/crypto-js/core.js"></script>
<script src="../../../assets/libs/crypto-js/enc-base64.js"></script>
<script src="../../../assets/libs/crypto-js/hmac.js"></script>
<script src="../../../assets/libs/crypto-js/sha1.js"></script>

<script src="../../../assets/base/plugin-init.js"></script>
<script type="text/javascript">
$(function() {
	/*
	Config.upload = "/m/actions/file/authorize.json";
	或
	Config.upload = {
		ak: "23255733",
		sk: "bae4d0a7acca52012069422807116473",
		namespace: "its",
		sizeLimit: 100 * 1024 * 1024, // 100MB
		// dir/name支持以下自定义占位符 {yy} {yyyy} {MM} {dd} {HH} {mm} {ss} {SSS} {random-1}~{random-10}
		dir : "${yyyy}/${MM}/${dd}/",
		name : "${HH}${mm}${ss}${SSS}${random-6}.${ext}"
	}
	*/
	$("button[name=upload]").on("click", function() {
		$("form").zupload({ 
			token:Config.upload,
			chunkSize: 100 * 1024,
			process:function(e) { console.log("--> " + e.percent + "%"); },
			step:function(e) { console.log(e.url); },
			done:function(e) { console.log("done!"); },
			error:function(e) { console.log(e.message); }
		});
	});
});
</script>
</html>